class StudentIterator:
    def __init__(self,data):
        self.data=data
        self.index=-1

    def __next__(self):
        if self.index>=len(self.data)-1:
            raise StopIteration
        self.index+=1
        return self.data[self.index]


class StudentController:
    def __init__(self):
        self.student_list=[]
    def __iter__(self):
            return StudentIterator(self.student_list)


controller=StudentController()
controller.student_list.append("lkp")
controller.student_list.append("lkpkp")
controller.student_list.append("lkpkpkp")
for item in controller:
    print(item)